// src/APP.vue

<template>
<div id="input-v-model-demo" class="demo">
  <div>
    <div>1、带v-model的自定义输入组件上使用自定义事件</div>
    <input v-model="searchText1" />
    <div>{{ searchText1 }}</div>
  </div>
  <br>

  <div>2、等价于</div>
  <div>
    <input :value="searchText2" @input="searchText2 = $event.target.value" />
    <div>{{ searchText2 }}</div>
  </div>
</div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'

export default defineComponent({
  name:"APP",
  setup(props, context) {
    const searchText1 = ref('')

    const searchText2 = ref('')

    return {
      searchText1,
      searchText2
    }
  }
})
</script>